<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <canvas id="cas" width="300" height="300"></canvas>
  <script>
    var ct = document.getElementById('cas').getContext('2d')
    ct.font = "30px Arial"
    ct.strokeStyle = "skyblue"
    ct.strokeText('welcome', 10, 50, 100)
    // vr obj1 = { x: 1 };
    // var num1 = 1;
    // var array1 = [obj1, num1];
    // obj1 = { x: 2 };
    // // obj1.x = 2
    // num1 = 2;
    // console.log(array1[0].x, array1[1]);a
    // Promise.resolve().then(() => {
    //   console.log(1);
    //   return Promise.reject();
    // }).catch(() => {
    //   console.log(2)
    // }).catch(() => {
    //   console.log(3)
    // }).then(() => {
    //   console.log(4)
    // })
    let i = 10;
    function create () {
      let i = 1;
      return function () {
        setTimeout(function () {
          i++;
        }, 0);
        console.log(i)
      }
    }
    const print1 = create();
    print1();
    print1();
    setTimeout(() => {
      print1()
    }, 1000);
    const print2 = create();
    print2();
    setTimeout(() => {
      print2()
    }, 1000);
  </script>
</body>

</html>